package edu.sdjzu.exam.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class ExamUpdateDTO {
    @NotNull(message = "试卷ID不能为空")
    private Long examId;

    @NotBlank(message = "试卷标题不能为空")
    private String title;

    private String description;

    @NotNull(message = "开始时间不能为空")
    private LocalDateTime startTime;

    @NotNull(message = "结束时间不能为空")
    private LocalDateTime endTime;

    @NotNull(message = "考试时长不能为空")
    private Integer durationMinutes;

    private List<ExamQuestionDTO> questions;

    @Data
    public static class ExamQuestionDTO {
        @NotNull(message = "题目ID不能为空")
        private Long questionId;

        @NotNull(message = "题目顺序不能为空")
        private Integer questionOrder;
        
        @NotNull(message = "题目分值不能为空")
        private BigDecimal score;
    }
}